const  {logI,logE}  = require('../log.js')

exports.retError = function (action,code,errmsg,res) {
    const ret={
        "code":code,
        "errmsg":errmsg
    }
    logE("S-A", "null", action, `${JSON.stringify(ret)}`, "null")
    res.send(ret);

};

exports.retSuccess = function (action,code,mac,msg,res) {
    const ret={
        "code":code,
    }
    if(msg){
        ret.msg =  msg;
    }
    logI("S-A", mac, action, `${JSON.stringify(ret)}`, "null")
    res.send(ret);

};

